<%@ page language="java" import="java.util.*, java.text.*,com.zjut.zs.util.tools.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*, com.zjut.an.util.module.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,com.zjut.zs.applyview.manager.*, com.zjut.zs.applyview.dao.*,
com.zjut.zs.userinfo.manager.*, com.zjut.zs.userinfo.dao.*,com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,
com.zjut.zs.exampage.manager.*, com.zjut.zs.exampage.dao.*" pageEncoding="utf-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">  
<meta name="renderer" content="webkit"> 
<title>无标题文档</title>

<link href="../plugins/assets/plugins/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<script src='../plugins/assets/plugins/jquery-3.5.1.min.js'></script>
<script src="js/jquery.qrcode-0.6.0.min.js"></script>
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript">
function printHtml(html) {
	var bodyHtml = document.body.innerHTML;
	document.body.innerHTML = html;
	window.print();
	document.body.innerHTML = bodyHtml;
}
function onprint() {
	var html = $("#container").html();
	printHtml(html);
}
</script>
</head>
<style type="text/css">
<!--
ul{display:block;margin:0;padding:0;list-style:none;}
li{display:block;margin:0;padding:0;list-style: none;}
.place{height:40px; background:url(images/righttop.gif) repeat-x;}
.place span{line-height:40px; font-weight:bold;float:left; margin-left:12px;}
.placeul li{float:left; line-height:40px; padding-left:7px; padding-right:12px; background:url(images/rlist.gif) no-repeat right;}
.placeul li:last-child{background:none;}

/*right.html*/
.place{height:40px; background:url(images/righttop.gif) repeat-x;font-size:9pt;}
.place span{line-height:40px; font-weight:bold;float:left; margin-left:12px;}
.placeul li{float:left; line-height:40px; padding-left:7px; padding-right:12px; background:url(images/rlist.gif) no-repeat right;}
.placeul li:last-child{background:none;}
.rightinfo{padding:8px;}
.tools{clear:both; height:35px; margin-bottom:8px;}
.toolbar{float:left;}
.toolbar li{background:url(images/toolbg.gif) repeat-x; line-height:33px; height:33px; border:solid 1px #d3dbde; float:left; padding-right:10px; margin-right:5px;border-radius: 3px; behavior:url(js/pie.htc); cursor:pointer;}
.toolbar li span{float:left; margin-left:10px; margin-right:5px; margin-top:5px;}
.toolbar1{float:right;width:300px;text-align:right;margin:2px;}
.toolbar1 li{background:url(images/toolbg.gif) repeat-x; line-height:33px; height:33px; border:solid 1px #d3dbde; float:left; padding-right:10px; margin-left:5px;border-radius: 3px; behavior:url(js/pie.htc);}
.toolbar1 li span{float:left; margin-left:10px; margin-right:5px; margin-top:5px;}
.tablelist{border:solid 1px #cbcbcb; width:100%; clear:both;}
.tablelist th{background:url(images/th.gif) repeat-x; height:34px; line-height:34px; border-bottom:solid 1px #b6cad2; text-indent:11px; text-align:left;}
.tablelist td{line-height:35px; height:35px; text-indent:11px; border-right: dotted 1px #c7c7c7; }
.tablelink{color:#056dae;}
.tablelist tbody tr.odd{background:#f5f8fa;}
.sort{padding-left:3px;}

/*form*/
.formbody{padding:10px 18px;}
.formtitle{border-bottom:solid 1px #d0dee5; line-height:35px; position:relative; height:35px; margin-bottom:28px;}
.formtitle span{font-weight:bold;font-size:14px; border-bottom:solid 3px #66c9f3;float:left; position:absolute; z-index:100; bottom:-1px; padding:0 3px; height:30px; line-height:30px;}
.forminfo{padding-left:23px;}
.forminfo li{margin-bottom:13px;}

.forminfo li label{width:100px;line-height:34px; display:block; float:left;}
.forminfo li i{color:#7f7f7f; padding-left:20px; font-style:normal;}
.forminfo li i.error {color:#c00;}
.forminfo li cite{display:block; padding-top:10px;}
.dfinput{width:345px; height:32px; line-height:32px; border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df; background:url(images/inputbg.gif) repeat-x; text-indent:10px;}
.sfinput{width:100px; height:32px; line-height:32px; border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df; background:url(images/inputbg.gif) repeat-x; text-indent:10px;}
.smfinput{width:50px; height:32px; line-height:32px; border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df; background:url(images/inputbg.gif) repeat-x; text-indent:10px;}
.textinput{border-top:solid 1px #a7b5bc; border-left:solid 1px #a7b5bc; border-right:solid 1px #ced9df; border-bottom:solid 1px #ced9df; background:url(images/inputbg.gif) repeat-x; padding:10px; width:504px; height:150px; line-height:20px; overflow:hidden;}
.btn{width:137px;height:35px; background:url(images/btnbg.png) no-repeat; font-size:14px;font-weight:bold;color:#fff; cursor:pointer;}
.btndisable{width:137px;height:35px; background:url(images/btnbgdisable.png) no-repeat; font-size:14px;font-weight:bold;color:#fff; cursor:pointer;}

-->
</style>
<body>
<jsp:include page="zs_uservalidate.jsp" flush="true"/>
<%
if (session.getAttribute("zsUser") == null&&session.getAttribute("admin") == null&&session.getAttribute("user") == null) {
	out.print("<script>alert('由于长时间未操作，系统已经自动注销，请重新登陆');</script>");
	out.print("<script>top.window.location='main.jsp';</script>");
} else {

AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
ZsHTMLCreat html = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");
ZsUserStatusManager usmanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsUserinfoManager uimanager = (ZsUserinfoManager) SpringContextUtil.getBean("ZsUserinfoManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsExamPageManager epmanager = (ZsExamPageManager) SpringContextUtil.getBean("ZsExamPageManager");
ZsApplyViewManager amanager = (ZsApplyViewManager) SpringContextUtil.getBean("ZsApplyViewManager");

ZsUser user = null;
if(session.getAttribute("admin")!=null && request.getParameter("usId")!=null) {
	String usId = request.getParameter("usId");
	user = umanager.getData(usId);
} else if (session.getAttribute("zsUser")!=null) {
	user = (ZsUser)session.getAttribute("zsUser");	
} 

ZsUserinfo userinfo = new ZsUserinfo();
if (user!=null) {
	userinfo.setZsUser(user);
	userinfo = (ZsUserinfo)uimanager.getDataByInstance(1,1,null,null,userinfo).getObjects().get(0);
}
ZsApplyView appview = amanager.getData(user.getUsId());

 %>
	<div class="place" style="margin-top:0;">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="index.jsp">首页</a></li>
    <li><a href="#">测试通知单</a></li>
    </ul>
    </div>
    
    <div class="xline"></div>
    <input type="button" onclick="onprint()" value="打印" class="btn btn-primary btn-sm" style="margin:20px;"/>
    <div id="container" class="container" style="width:1000px;">
   
    <%
    ZsExamPage exampage = new ZsExamPage();
    exampage.setExType("测试通知单");
    PageModule pagemodule = epmanager.getDataByInstance(1,1,null,null,exampage);
    if(pagemodule.getTotal()>0){
    	exampage = (ZsExamPage)pagemodule.getObjects().get(0);
    }
    if (null!=exampage.getExId()) {
    	String content = exampage.getExContent().replace("$usName$", appview.getUsName())
    			.replace("$usIdcard$", html.getInputString(appview.getUsIdcard()))
    	    	.replace("$usEmail$", html.getInputString(appview.getUsEmail()))
    	    	.replace("$usMobile$", html.getInputString(appview.getUsMobile()))
    	    	.replace("$testNo$", html.getInputString(appview.getTestNo()))
    	    	.replace("$column1$", html.getInputString(appview.getColumn1()))
    	    	.replace("$column2$", html.getInputString(appview.getColumn2()))
    	    	.replace("$column3$", html.getInputString(appview.getColumn3()))
    	    	.replace("$column4$", html.getInputString(appview.getColumn4()))
    	    	.replace("$column5$", html.getInputString(appview.getColumn5()))
    	    	.replace("$column6$", html.getInputString(appview.getColumn6()))
    	    	.replace("$column7$", html.getInputString(appview.getColumn7()))
    	    	.replace("$column8$", html.getInputString(appview.getColumn8()))
    	    	.replace("$column9$", html.getInputString(appview.getColumn9()))
    	    	.replace("$column10$", html.getInputString(appview.getColumn10()))
    	    	.replace("$inZydm01$", html.getInputString(appview.getInZydm01()))
    	    	.replace("$inZydm02$", html.getInputString(appview.getInZydm02()))
    	    	.replace("$inZydm03$", html.getInputString(appview.getInZydm03()))
    	    	.replace("$inZydm04$", html.getInputString(appview.getInZydm04()))
    	    	.replace("$inZydm05$", html.getInputString(appview.getInZydm05()))
    	    	.replace("$inZydm06$", html.getInputString(appview.getInZydm06()))
    	    	.replace("$inZydm07$", html.getInputString(appview.getInZydm07()))
    	    	.replace("$inZydm08$", html.getInputString(appview.getInZydm08()))
    	    	.replace("$inZydm09$", html.getInputString(appview.getInZydm09()))
    	    	.replace("$inZydm10$", html.getInputString(appview.getInZydm10()))
    	    	.replace("$inZymc01$", html.getInputString(appview.getInZymc01()))
    	    	.replace("$inZymc02$", html.getInputString(appview.getInZymc02()))
    	    	.replace("$inZymc03$", html.getInputString(appview.getInZymc03()))
    	    	.replace("$inZymc04$", html.getInputString(appview.getInZymc04()))
    	    	.replace("$inZymc05$", html.getInputString(appview.getInZymc05()))
    	    	.replace("$inZymc06$", html.getInputString(appview.getInZymc06()))
    	    	.replace("$inZymc07$", html.getInputString(appview.getInZymc07()))
    	    	.replace("$inZymc08$", html.getInputString(appview.getInZymc08()))
    	    	.replace("$inZymc09$", html.getInputString(appview.getInZymc09()))
    	    	.replace("$inZymc10$", html.getInputString(appview.getInZymc10()))
    	    	.replace("$scColumn1$", html.getInputString(appview.getScColumn1()))
    	    	.replace("$scColumn2$", html.getInputString(appview.getScColumn2()))
    	    	.replace("$scColumn3$", html.getInputString(appview.getScColumn3()))
    	    	.replace("$scColumn4$", html.getInputString(appview.getScColumn4()))
    	    	.replace("$scColumn5$", html.getInputString(appview.getScColumn5()))
    	    	.replace("$scColumn6$", html.getInputString(appview.getScColumn6()))
    	    	.replace("$scColumn7$", html.getInputString(appview.getScColumn7()))
    	    	.replace("$scColumn8$", html.getInputString(appview.getScColumn8()))
    	    	.replace("$scColumn9$", html.getInputString(appview.getScColumn9()))
    	    	.replace("$scColumn10$", html.getInputString(appview.getScColumn10()))
    	    	.replace("$inXb$", html.getInputString(appview.getInXb()))
    	    	.replace("$inMz$", html.getInputString(appview.getInMz()))
    	    	.replace("$inZzmm$", html.getInputString(appview.getInZzmm()))
    	    	.replace("$usBmxh$", html.getInputString(appview.getUsBmxh())) 
    	    	.replace("$inKslb$", html.getInputString(appview.getInKslb()))
    	    	.replace("$inLxdh2$", html.getInputString(appview.getInLxdh2()))
    	    	.replace("$inByxxmc$", html.getInputString(appview.getInByxxmc()))
    	    	.replace("$testNoOrder$", html.getInputString(appview.getInPinying()))
    	    	.replace("$receiveno$", user.getUsNo());
    	content = content.replace("src=\"inPhoto\"", "src='../photo/"+html.getInputString(user.getUsIdcard())+".jpg' ");   		
	    out.print(content);
    } else {
    	out.print("尚未发布测试通知单");
    }
    %>
	</div>
<script>
$("#ewcode1").attr("src","http://qr.topscan.com/api.php?text=<%=anconfig.getSingleConfigInfoByName("网站域名") %>/admin/zsApplyViewStatus.jsp?usId=<%=user.getUsId()%>&localStatusType=single"); 
$("#ewcode2").attr("src","http://qr.topscan.com/api.php?text=<%=anconfig.getSingleConfigInfoByName("网站域名") %>/admin/zsApplyViewEdit.jsp?usId=<%=user.getUsId()%>"); 

</script>
<%} %>
</body>
</html>
